package ru.spbau.database.group3.queryEvaluator;

import ru.spbau.database.group3.engine.DatabaseEngine;

import java.io.IOException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: stas
 * Date: 1/29/13
 * Time: 7:46 PM
 */
public class CreateIndexInstruction implements Instruction {
    public CreateIndexInstruction(String indexName, String tableName, List<String> columnNames, List<String> orders, String type) {
        this.indexName = indexName;
        this.tableName = tableName;
        this.columnNames = columnNames;
        this.orders = orders;
        this.type = type;
    }

    @Override
    public QueryResult handle(DatabaseEngine engine) throws IOException, ClassNotFoundException {
        return engine.createIndexRequest(tableName, indexName, columnNames, orders, type);
    }

    private String indexName;
    private String tableName;
    private List<String> columnNames;
    private List<String> orders;
    private String type;
}
